var fs = require("fs")
const env = process.argv.slice(2)[0];

const envMap = {
	"dev": {
		"HOST": "localhost/HiSprites/",
		"HTTP_PROTOCOL": "http://",
		"WS_PROTOCOL": "ws://"
	},
	"release": {
		"HOST": "www.leedvan.xyz/HiSprites/",
		"HTTP_PROTOCOL": "https://",
		"WS_PROTOCOL": "wss://"
	}
}

const config = envMap[env]

fs.writeFile(
	"env.js",
	`/*edit-disable*/
	export const ENV_CONFIG = ${JSON.stringify(config)}`,
	function(error){}
)